<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()
const goDetail = () => {
  router.push({ path: '/video', query: { id: 1 } })
}
</script>

<template>
  <div class="consult" @click="goDetail">
    <div class="consult-left">
      <el-image fit="fill" src="src/static/test.png" style="width:100%;height: 100% "></el-image>
    </div>
    <div class="consult-right">
      <div class="title">
        文章的名字
      </div>
      <div class="content">
        文章的内容文章的内容文章的内容文章的内容文章的内容文章的内容文章的内容文章的内容
      </div>
      <div class="tag">
        <img src="@/static/tag.png" style="width: 20px;height: 20px"></img>
        话题标签
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.consult {
  width: 100%;
  height: 200px;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.15s ease-in-out;
  border-radius: 5px;

  &:hover {
    transform: scale3d(1.03, 1.03, 1);
    cursor: pointer;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1);
  }

  &-left {
    height: 100%;
    flex: 3;
  }

  &-right {
    padding: 10px;
    height: 100%;
    flex: 5;
    display: flex;
    flex-direction: column;

    .title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 10px;
      //  只有一行
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .content {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
    }

    .tag {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: $lt-main-text-color;
      gap: 3px;
    }
  }
}
</style>